package com.git.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.git.domain.BaseDataResponse;
import com.git.domain.ResultCode;
import com.git.util.MessageUtil;

@RestController
@RequestMapping("message")
public class MessageController {
	
	@RequestMapping("/get/{code}")
	public BaseDataResponse<String> insert(HttpServletRequest request,@PathVariable("code")String code,String...args){
		String message = MessageUtil.getMessage(code, args, LocaleContextHolder.getLocale());
		
		return new BaseDataResponse<String>(ResultCode.SUCCESSFUL_CODE, message);
	}
}
